//package com.baizhi.cmfz.config;
//
//import com.baizhi.cmfz.shiro.AuthenRealm2;
//import org.apache.shiro.mgt.DefaultSecurityManager;
//import org.apache.shiro.mgt.SecurityManager;
//import org.apache.shiro.spring.web.ShiroFilterFactoryBean;
//import org.apache.shiro.web.mgt.DefaultWebSecurityManager;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
//import java.util.HashMap;
//
//@Configuration
//public class ShiroConfig2 {
//
//	@Bean
//	public ShiroFilterFactoryBean getShiroFilterFactoryBean(SecurityManager securityManager){
//		ShiroFilterFactoryBean shiroFilterFactoryBean = new ShiroFilterFactoryBean();
//		HashMap<String, String> map = new HashMap<>();
//		map.put("/admin/*","anon");
//		map.put("/login.jsp","anon");
//		map.put("/jsp/*","authc");
//		shiroFilterFactoryBean.setFilterChainDefinitionMap(map);
//		shiroFilterFactoryBean.setSecurityManager(securityManager);
//		return shiroFilterFactoryBean;
//	}
//
//
//	@Bean
//	public SecurityManager getSecurityManager(AuthenRealm2 authenRealm2){
//		DefaultSecurityManager defaultSecurityManager = new DefaultWebSecurityManager();
//		defaultSecurityManager.setRealm(authenRealm2);
//		return defaultSecurityManager;
//
//	}
//
//	/**
//	 * 这个方法返回自己定义的inof处理对象
//	 * @return 返回实现 的对象的实例
//	 */
//	@Bean
//	public AuthenRealm2 getAuthenRealm2(){
//		return new AuthenRealm2();
//	}
//}
